#include <iostream>
#include <string>
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;

  cin >> s;
  int cnt = 0, ans = 0;
  char last_ch = '$';
  for (int i = 0; i < s.size(); i++) {
    if (last_ch == s[i]) {
      ++cnt;
    } else {
      last_ch = s[i];
      cnt = 1;
    }
    ans = max(ans, cnt);
  }
  cout << ans << "\n";
  return 0;
}
